<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>交易</title>
<meta name="keywords" content="天天互保"> 
<meta name="description" content="天天互保"> 
<meta content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" name="viewport">
<script src="__JS__/jquery.min.js"></script>
<script language="javascript">
	function get_mobile_code(){
        $.post('__URL__/sms', {mobile:jQuery.trim($('#mobile').val()),send_code:<?php echo $_SESSION['send_code'];?>}, function(msg) {
            alert(jQuery.trim(unescape(msg)));
			if(msg=='提交成功'){
				RemainTime();
			}
        });
	};
	var iTime = 59;
	var Account;
	function RemainTime(){
		document.getElementById('zphone').disabled = true;
		var iSecond,sSecond="",sTime="";
		if (iTime >= 0){
			iSecond = parseInt(iTime%60);
			iMinute = parseInt(iTime/60)
			if (iSecond >= 0){
				if(iMinute>0){
					sSecond = iMinute + "分" + iSecond + "秒";
				}else{
					sSecond = iSecond + "秒";
				}
			}
			sTime=sSecond;
			if(iTime==0){
				clearTimeout(Account);
				sTime='获取手机验证码';
				iTime = 59;
				document.getElementById('zphone').disabled = false;
			}else{
				Account = setTimeout("RemainTime()",1000);
				iTime=iTime-1;
			}
		}else{
			sTime='没有倒计时';
		}
		$("#zphone").html(sTime);
	}	
</script>
<body>
<div class="regs textleft font14">请绑定您的手机号</div> 
<form id='form' action="__URL__/index" method="post" name="formUser">
<ul class="uslist font14">
	<li class="updates">
		<p>手机号</p>
		<div class="inputs">
			<input type="text" id="mobile" name="mobile" placeholder="您的手机号" value="" class="inputtype inputBg font14"  pattern="(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$" required/>
			<label for="phone" class="errorinfo tel"> </label>
		</div>
	</li>
	<li class="updates bottom">
		<p>验证码</p>
		<div class="inputs">
			<input type="text" name="mobile_code" placeholder="您的验证码" value="" class="inputtype font14 otherinput" required/>
			<button class="font12 otherbtn" id="zphone" onClick="get_mobile_code();">获取验证码</button>
		</div>
	</li>
		<li class="updates">
		<p>登录密码</p>
		<div class="inputs">
			<input type="password" name="pwd" placeholder="密码" value="" pattern="^[a-zA-Z][a-zA-Z0-9_]{4,15}$" class="inputtype font14 pwd" min="6" required/>
			<label for="phone" class="errorinfo pass" style="color:red"> </label>
		</div>
	</li>
		<li class="updates">
		<p>再次输入密码</p>
		<div class="inputs">
			<input type="password" name="apwd" placeholder="再次输入密码" value="" class="inputtype apwd font14" min="6" required/>
			<label for="phone" class="errorinfo pass" style="color:red"> </label>
		</div>
	</li>
<li class="updates">
	<p>邀请码</p>
	<input type="password" name="yqm" placeholder="邀请码" value=""  min="6" required/>
</li>
		
</ul>
<div style="height:15px;"></div>
<input type="button" onclick="c()" value="绑定" class="submits font14"/>
	</form>
<!-- onclick="window.location.href='new_pwd.html'"-->
<script>
function c() {
	var myReg = /^1[3|4|5|7|8]\d{9}$/; //电话正则
	var pwd = $(".pwd").val();
	var apwd= $(".apwd").val();
	if(!myReg.test($('#mobile').val())){
				$(".tel").html('您的账号格式错咯！')
			}else if($('#mobile').val()==""){
				$(".tel").html('号码不能为空')
			}else if(pwd!=apwd){
				$(".pass").html('两次密码不一致')
		}else{
			$("#form").submit();
		}
}








$('#submit_btn').click(function(){
				show_loading();
				
				if($('#email').val() == ''){
					show_err_msg('账号还没填呢！');	
					$('#email').focus();
				}else if(!myReg.test($('#email').val())){
					show_err_msg('您的账号格式错咯！');
					$('#email').focus();
				}else if($('#password').val() == ''){
					show_err_msg('密码还没填呢！');
					$('#password').focus();
				}else{
					// ajax提交表单，#login_form为表单的ID。 如：$('#login_form').ajaxSubmit(function(data) { ... });
				$('#login_form').submit();
					// show_msg('登录成功咯！  正在为您跳转...','/');	
				}
			});
	
</script>
</body>
</html>
